\(\int \frac {f+g x+h x^2}{(d+e x)^2 (a+b x+c x^2)} \, dx\) [153]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [F(-1)]
   Sympy [F(-1)]
   Maxima [F(-2)]
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 30, antiderivative size = 316 \[ \int \frac {f+g x+h x^2}{(d+e x)^2 \left (a+b x+c x^2\right )} \, dx=-\frac {e^2 f-d e g+d^2 h}{e \left (c d^2-b d e+a e^2\right ) (d+e x)}-\frac {\left (2 c^2 d^2 f+2 a^2 e^2 h-a b e (e g+2 d h)+b^2 \left (e^2 f+d^2 h\right )-c \left (b d (2 e f+d g)+2 a \left (e^2 f-2 d e g+d^2 h\right )\right )\right ) \text {arctanh}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{\sqrt {b^2-4 a c} \left (c d^2-b d e+a e^2\right )^2}+\frac {\left (c d (2 e f-d g)+a e (e g-2 d h)-b \left (e^2 f-d^2 h\right )\right ) \log (d+e x)}{\left (c d^2-b d e+a e^2\right )^2}-\frac {\left (c d (2 e f-d g)+a e (e g-2 d h)-b \left (e^2 f-d^2 h\right )\right ) \log \left (a+b x+c x^2\right )}{2 \left (c d^2-b d e+a e^2\right )^2} \]

[Out]

(-d^2*h+d*e*g-e^2*f)/e/(a*e^2-b*d*e+c*d^2)/(e*x+d)+(c*d*(-d*g+2*e*f)+a*e*(-2*d*h+e*g)-b*(-d^2*h+e^2*f))*ln(e*x
+d)/(a*e^2-b*d*e+c*d^2)^2-1/2*(c*d*(-d*g+2*e*f)+a*e*(-2*d*h+e*g)-b*(-d^2*h+e^2*f))*ln(c*x^2+b*x+a)/(a*e^2-b*d*
e+c*d^2)^2-(2*c^2*d^2*f+2*a^2*e^2*h-a*b*e*(2*d*h+e*g)+b^2*(d^2*h+e^2*f)-c*(b*d*(d*g+2*e*f)+2*a*(d^2*h-2*d*e*g+
e^2*f)))*arctanh((2*c*x+b)/(-4*a*c+b^2)^(1/2))/(a*e^2-b*d*e+c*d^2)^2/(-4*a*c+b^2)^(1/2)

Rubi [A] (verified)

Time = 0.43 (sec) , antiderivative size = 316, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {1642, 648, 632, 212, 642} \[ \int \frac {f+g x+h x^2}{(d+e x)^2 \left (a+b x+c x^2\right )} \, dx=-\frac {\text {arctanh}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right ) \left (2 a^2 e^2 h-c \left (2 a \left (d^2 h-2 d e g+e^2 f\right )+b d (d g+2 e f)\right )-a b e (2 d h+e g)+b^2 \left (d^2 h+e^2 f\right )+2 c^2 d^2 f\right )}{\sqrt {b^2-4 a c} \left (a e^2-b d e+c d^2\right )^2}-\frac {\log \left (a+b x+c x^2\right ) \left (a e (e g-2 d h)-b \left (e^2 f-d^2 h\right )+c d (2 e f-d g)\right )}{2 \left (a e^2-b d e+c d^2\right )^2}-\frac {d^2 h-d e g+e^2 f}{e (d+e x) \left (a e^2-b d e+c d^2\right )}+\frac {\log (d+e x) \left (a e (e g-2 d h)-b \left (e^2 f-d^2 h\right )+c d (2 e f-d g)\right )}{\left (a e^2-b d e+c d^2\right )^2} \]

[In]

Int[(f + g*x + h*x^2)/((d + e*x)^2*(a + b*x + c*x^2)),x]

[Out]

-((e^2*f - d*e*g + d^2*h)/(e*(c*d^2 - b*d*e + a*e^2)*(d + e*x))) - ((2*c^2*d^2*f + 2*a^2*e^2*h - a*b*e*(e*g +
2*d*h) + b^2*(e^2*f + d^2*h) - c*(b*d*(2*e*f + d*g) + 2*a*(e^2*f - 2*d*e*g + d^2*h)))*ArcTanh[(b + 2*c*x)/Sqrt
[b^2 - 4*a*c]])/(Sqrt[b^2 - 4*a*c]*(c*d^2 - b*d*e + a*e^2)^2) + ((c*d*(2*e*f - d*g) + a*e*(e*g - 2*d*h) - b*(e
^2*f - d^2*h))*Log[d + e*x])/(c*d^2 - b*d*e + a*e^2)^2 - ((c*d*(2*e*f - d*g) + a*e*(e*g - 2*d*h) - b*(e^2*f -
d^2*h))*Log[a + b*x + c*x^2])/(2*(c*d^2 - b*d*e + a*e^2)^2)

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 632

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 642

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[d*(Log[RemoveContent[a + b*x +
c*x^2, x]]/b), x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rule 648

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[(2*c*d - b*e)/(2*c), Int[1/(a +
 b*x + c*x^2), x], x] + Dist[e/(2*c), Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x] &
& NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] &&  !NiceSqrtQ[b^2 - 4*a*c]

Rule 1642

Int[(Pq_)*((d_.) + (e_.)*(x_))^(m_.)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegra
nd[(d + e*x)^m*Pq*(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

Rubi steps \begin{align*} \text {integral}& = \int \left (\frac {e^2 f-d e g+d^2 h}{\left (c d^2-b d e+a e^2\right ) (d+e x)^2}+\frac {e \left (c d (2 e f-d g)+a e (e g-2 d h)-b \left (e^2 f-d^2 h\right )\right )}{\left (c d^2-b d e+a e^2\right )^2 (d+e x)}+\frac {c^2 d^2 f+e^2 \left (b^2 f-a b g+a^2 h\right )-c \left (2 b d e f+a \left (e^2 f-2 d e g+d^2 h\right )\right )-c \left (c d (2 e f-d g)+a e (e g-2 d h)-b \left (e^2 f-d^2 h\right )\right ) x}{\left (c d^2-b d e+a e^2\right )^2 \left (a+b x+c x^2\right )}\right ) \, dx \\ & = -\frac {e^2 f-d e g+d^2 h}{e \left (c d^2-b d e+a e^2\right ) (d+e x)}+\frac {\left (c d (2 e f-d g)+a e (e g-2 d h)-b \left (e^2 f-d^2 h\right )\right ) \log (d+e x)}{\left (c d^2-b d e+a e^2\right )^2}+\frac {\int \frac {c^2 d^2 f+e^2 \left (b^2 f-a b g+a^2 h\right )-c \left (2 b d e f+a \left (e^2 f-2 d e g+d^2 h\right )\right )-c \left (c d (2 e f-d g)+a e (e g-2 d h)-b \left (e^2 f-d^2 h\right )\right ) x}{a+b x+c x^2} \, dx}{\left (c d^2-b d e+a e^2\right )^2} \\ & = -\frac {e^2 f-d e g+d^2 h}{e \left (c d^2-b d e+a e^2\right ) (d+e x)}+\frac {\left (c d (2 e f-d g)+a e (e g-2 d h)-b \left (e^2 f-d^2 h\right )\right ) \log (d+e x)}{\left (c d^2-b d e+a e^2\right )^2}-\frac {\left (c d (2 e f-d g)+a e (e g-2 d h)-b \left (e^2 f-d^2 h\right )\right ) \int \frac {b+2 c x}{a+b x+c x^2} \, dx}{2 \left (c d^2-b d e+a e^2\right )^2}+\frac {\left (2 c^2 d^2 f+2 a^2 e^2 h-a b e (e g+2 d h)+b^2 \left (e^2 f+d^2 h\right )-c \left (b d (2 e f+d g)+2 a \left (e^2 f-2 d e g+d^2 h\right )\right )\right ) \int \frac {1}{a+b x+c x^2} \, dx}{2 \left (c d^2-b d e+a e^2\right )^2} \\ & = -\frac {e^2 f-d e g+d^2 h}{e \left (c d^2-b d e+a e^2\right ) (d+e x)}+\frac {\left (c d (2 e f-d g)+a e (e g-2 d h)-b \left (e^2 f-d^2 h\right )\right ) \log (d+e x)}{\left (c d^2-b d e+a e^2\right )^2}-\frac {\left (c d (2 e f-d g)+a e (e g-2 d h)-b \left (e^2 f-d^2 h\right )\right ) \log \left (a+b x+c x^2\right )}{2 \left (c d^2-b d e+a e^2\right )^2}-\frac {\left (2 c^2 d^2 f+2 a^2 e^2 h-a b e (e g+2 d h)+b^2 \left (e^2 f+d^2 h\right )-c \left (b d (2 e f+d g)+2 a \left (e^2 f-2 d e g+d^2 h\right )\right )\right ) \text {Subst}\left (\int \frac {1}{b^2-4 a c-x^2} \, dx,x,b+2 c x\right )}{\left (c d^2-b d e+a e^2\right )^2} \\ & = -\frac {e^2 f-d e g+d^2 h}{e \left (c d^2-b d e+a e^2\right ) (d+e x)}-\frac {\left (2 c^2 d^2 f+2 a^2 e^2 h-a b e (e g+2 d h)+b^2 \left (e^2 f+d^2 h\right )-c \left (b d (2 e f+d g)+2 a \left (e^2 f-2 d e g+d^2 h\right )\right )\right ) \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{\sqrt {b^2-4 a c} \left (c d^2-b d e+a e^2\right )^2}+\frac {\left (c d (2 e f-d g)+a e (e g-2 d h)-b \left (e^2 f-d^2 h\right )\right ) \log (d+e x)}{\left (c d^2-b d e+a e^2\right )^2}-\frac {\left (c d (2 e f-d g)+a e (e g-2 d h)-b \left (e^2 f-d^2 h\right )\right ) \log \left (a+b x+c x^2\right )}{2 \left (c d^2-b d e+a e^2\right )^2} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.30 (sec) , antiderivative size = 281, normalized size of antiderivative = 0.89 \[ \int \frac {f+g x+h x^2}{(d+e x)^2 \left (a+b x+c x^2\right )} \, dx=\frac {-\frac {2 \left (c d^2+e (-b d+a e)\right ) \left (e^2 f-d e g+d^2 h\right )}{e (d+e x)}+\frac {2 \left (2 c^2 d^2 f+2 a^2 e^2 h-a b e (e g+2 d h)+b^2 \left (e^2 f+d^2 h\right )-c \left (b d (2 e f+d g)+2 a \left (e^2 f-2 d e g+d^2 h\right )\right )\right ) \arctan \left (\frac {b+2 c x}{\sqrt {-b^2+4 a c}}\right )}{\sqrt {-b^2+4 a c}}+2 \left (c d (2 e f-d g)+a e (e g-2 d h)+b \left (-e^2 f+d^2 h\right )\right ) \log (d+e x)+\left (c d (-2 e f+d g)+a e (-e g+2 d h)+b \left (e^2 f-d^2 h\right )\right ) \log (a+x (b+c x))}{2 \left (c d^2+e (-b d+a e)\right )^2} \]

[In]

Integrate[(f + g*x + h*x^2)/((d + e*x)^2*(a + b*x + c*x^2)),x]

[Out]

((-2*(c*d^2 + e*(-(b*d) + a*e))*(e^2*f - d*e*g + d^2*h))/(e*(d + e*x)) + (2*(2*c^2*d^2*f + 2*a^2*e^2*h - a*b*e
*(e*g + 2*d*h) + b^2*(e^2*f + d^2*h) - c*(b*d*(2*e*f + d*g) + 2*a*(e^2*f - 2*d*e*g + d^2*h)))*ArcTan[(b + 2*c*
x)/Sqrt[-b^2 + 4*a*c]])/Sqrt[-b^2 + 4*a*c] + 2*(c*d*(2*e*f - d*g) + a*e*(e*g - 2*d*h) + b*(-(e^2*f) + d^2*h))*
Log[d + e*x] + (c*d*(-2*e*f + d*g) + a*e*(-(e*g) + 2*d*h) + b*(e^2*f - d^2*h))*Log[a + x*(b + c*x)])/(2*(c*d^2
 + e*(-(b*d) + a*e))^2)

Maple [A] (verified)

Time = 0.72 (sec) , antiderivative size = 346, normalized size of antiderivative = 1.09

method result size
default \(-\frac {d^{2} h -d e g +e^{2} f}{\left (e^{2} a -b d e +c \,d^{2}\right ) e \left (e x +d \right )}-\frac {\left (2 a d e h -a \,e^{2} g -b \,d^{2} h +b \,e^{2} f +c \,d^{2} g -2 c d e f \right ) \ln \left (e x +d \right )}{\left (e^{2} a -b d e +c \,d^{2}\right )^{2}}+\frac {\frac {\left (2 a c d h e -a c \,e^{2} g -b c \,d^{2} h +b c \,e^{2} f +c^{2} d^{2} g -2 c^{2} d e f \right ) \ln \left (c \,x^{2}+b x +a \right )}{2 c}+\frac {2 \left (a^{2} e^{2} h -a b \,e^{2} g -a c \,d^{2} h +2 a c d e g -a c \,e^{2} f +b^{2} e^{2} f -2 b c d e f +c^{2} d^{2} f -\frac {\left (2 a c d h e -a c \,e^{2} g -b c \,d^{2} h +b c \,e^{2} f +c^{2} d^{2} g -2 c^{2} d e f \right ) b}{2 c}\right ) \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\sqrt {4 a c -b^{2}}}}{\left (e^{2} a -b d e +c \,d^{2}\right )^{2}}\) \(346\)
risch \(\text {Expression too large to display}\) \(1663\)

[In]

int((h*x^2+g*x+f)/(e*x+d)^2/(c*x^2+b*x+a),x,method=_RETURNVERBOSE)

[Out]

-(d^2*h-d*e*g+e^2*f)/(a*e^2-b*d*e+c*d^2)/e/(e*x+d)-(2*a*d*e*h-a*e^2*g-b*d^2*h+b*e^2*f+c*d^2*g-2*c*d*e*f)/(a*e^
2-b*d*e+c*d^2)^2*ln(e*x+d)+1/(a*e^2-b*d*e+c*d^2)^2*(1/2*(2*a*c*d*e*h-a*c*e^2*g-b*c*d^2*h+b*c*e^2*f+c^2*d^2*g-2
*c^2*d*e*f)/c*ln(c*x^2+b*x+a)+2*(a^2*e^2*h-a*b*e^2*g-a*c*d^2*h+2*a*c*d*e*g-a*c*e^2*f+b^2*e^2*f-2*b*c*d*e*f+c^2
*d^2*f-1/2*(2*a*c*d*e*h-a*c*e^2*g-b*c*d^2*h+b*c*e^2*f+c^2*d^2*g-2*c^2*d*e*f)*b/c)/(4*a*c-b^2)^(1/2)*arctan((2*
c*x+b)/(4*a*c-b^2)^(1/2)))

Fricas [F(-1)]

Timed out. \[ \int \frac {f+g x+h x^2}{(d+e x)^2 \left (a+b x+c x^2\right )} \, dx=\text {Timed out} \]

[In]

integrate((h*x^2+g*x+f)/(e*x+d)^2/(c*x^2+b*x+a),x, algorithm="fricas")

[Out]

Timed out

Sympy [F(-1)]

Timed out. \[ \int \frac {f+g x+h x^2}{(d+e x)^2 \left (a+b x+c x^2\right )} \, dx=\text {Timed out} \]

[In]

integrate((h*x**2+g*x+f)/(e*x+d)**2/(c*x**2+b*x+a),x)

[Out]

Timed out

Maxima [F(-2)]

Exception generated. \[ \int \frac {f+g x+h x^2}{(d+e x)^2 \left (a+b x+c x^2\right )} \, dx=\text {Exception raised: ValueError} \]

[In]

integrate((h*x^2+g*x+f)/(e*x+d)^2/(c*x^2+b*x+a),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*a*c-b^2>0)', see `assume?` f
or more deta

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 459, normalized size of antiderivative = 1.45 \[ \int \frac {f+g x+h x^2}{(d+e x)^2 \left (a+b x+c x^2\right )} \, dx=-\frac {{\left (2 \, c d e f - b e^{2} f - c d^{2} g + a e^{2} g + b d^{2} h - 2 \, a d e h\right )} \log \left (c - \frac {2 \, c d}{e x + d} + \frac {c d^{2}}{{\left (e x + d\right )}^{2}} + \frac {b e}{e x + d} - \frac {b d e}{{\left (e x + d\right )}^{2}} + \frac {a e^{2}}{{\left (e x + d\right )}^{2}}\right )}{2 \, {\left (c^{2} d^{4} - 2 \, b c d^{3} e + b^{2} d^{2} e^{2} + 2 \, a c d^{2} e^{2} - 2 \, a b d e^{3} + a^{2} e^{4}\right )}} - \frac {\frac {e^{3} f}{e x + d} - \frac {d e^{2} g}{e x + d} + \frac {d^{2} e h}{e x + d}}{c d^{2} e^{2} - b d e^{3} + a e^{4}} + \frac {{\left (2 \, c^{2} d^{2} e^{2} f - 2 \, b c d e^{3} f + b^{2} e^{4} f - 2 \, a c e^{4} f - b c d^{2} e^{2} g + 4 \, a c d e^{3} g - a b e^{4} g + b^{2} d^{2} e^{2} h - 2 \, a c d^{2} e^{2} h - 2 \, a b d e^{3} h + 2 \, a^{2} e^{4} h\right )} \arctan \left (\frac {2 \, c d - \frac {2 \, c d^{2}}{e x + d} - b e + \frac {2 \, b d e}{e x + d} - \frac {2 \, a e^{2}}{e x + d}}{\sqrt {-b^{2} + 4 \, a c} e}\right )}{{\left (c^{2} d^{4} - 2 \, b c d^{3} e + b^{2} d^{2} e^{2} + 2 \, a c d^{2} e^{2} - 2 \, a b d e^{3} + a^{2} e^{4}\right )} \sqrt {-b^{2} + 4 \, a c} e^{2}} \]

[In]

integrate((h*x^2+g*x+f)/(e*x+d)^2/(c*x^2+b*x+a),x, algorithm="giac")

[Out]

-1/2*(2*c*d*e*f - b*e^2*f - c*d^2*g + a*e^2*g + b*d^2*h - 2*a*d*e*h)*log(c - 2*c*d/(e*x + d) + c*d^2/(e*x + d)
^2 + b*e/(e*x + d) - b*d*e/(e*x + d)^2 + a*e^2/(e*x + d)^2)/(c^2*d^4 - 2*b*c*d^3*e + b^2*d^2*e^2 + 2*a*c*d^2*e
^2 - 2*a*b*d*e^3 + a^2*e^4) - (e^3*f/(e*x + d) - d*e^2*g/(e*x + d) + d^2*e*h/(e*x + d))/(c*d^2*e^2 - b*d*e^3 +
 a*e^4) + (2*c^2*d^2*e^2*f - 2*b*c*d*e^3*f + b^2*e^4*f - 2*a*c*e^4*f - b*c*d^2*e^2*g + 4*a*c*d*e^3*g - a*b*e^4
*g + b^2*d^2*e^2*h - 2*a*c*d^2*e^2*h - 2*a*b*d*e^3*h + 2*a^2*e^4*h)*arctan((2*c*d - 2*c*d^2/(e*x + d) - b*e +
2*b*d*e/(e*x + d) - 2*a*e^2/(e*x + d))/(sqrt(-b^2 + 4*a*c)*e))/((c^2*d^4 - 2*b*c*d^3*e + b^2*d^2*e^2 + 2*a*c*d
^2*e^2 - 2*a*b*d*e^3 + a^2*e^4)*sqrt(-b^2 + 4*a*c)*e^2)

Mupad [B] (verification not implemented)

Time = 28.23 (sec) , antiderivative size = 3991, normalized size of antiderivative = 12.63 \[ \int \frac {f+g x+h x^2}{(d+e x)^2 \left (a+b x+c x^2\right )} \, dx=\text {Too large to display} \]

[In]

int((f + g*x + h*x^2)/((d + e*x)^2*(a + b*x + c*x^2)),x)

[Out]

(log(d + e*x)*(e^2*(a*g - b*f) + d^2*(b*h - c*g) - d*e*(2*a*h - 2*c*f)))/(a^2*e^4 + c^2*d^4 + b^2*d^2*e^2 - 2*
a*b*d*e^3 - 2*b*c*d^3*e + 2*a*c*d^2*e^2) + (log(2*a*b^3*e^4*f - 2*b^2*c^2*d^4*g - 2*a^2*b^2*e^4*g + 6*a*c^3*d^
4*g + b*c^3*d^4*f + a^3*b*e^4*h + 6*a^3*c*e^4*g + 2*b^3*c*d^4*h + 2*b^4*e^4*f*x + 2*c^4*d^4*f*x - c^3*d^4*f*(b
^2 - 4*a*c)^(1/2) + a^3*e^4*h*(b^2 - 4*a*c)^(1/2) - 7*a^2*b*c*e^4*f - 7*a*b*c^2*d^4*h - 16*a*c^3*d^3*e*f - 16*
a^3*c*d*e^3*h - 2*a*b^3*e^4*g*x - 2*a*c^3*d^4*h*x - b*c^3*d^4*g*x - 2*a^3*c*e^4*h*x + 2*a*b^2*e^4*f*(b^2 - 4*a
*c)^(1/2) - 2*a^2*b*e^4*g*(b^2 - 4*a*c)^(1/2) - a^2*c*e^4*f*(b^2 - 4*a*c)^(1/2) + a*c^2*d^4*h*(b^2 - 4*a*c)^(1
/2) + 2*b*c^2*d^4*g*(b^2 - 4*a*c)^(1/2) - 2*b^2*c*d^4*h*(b^2 - 4*a*c)^(1/2) + 2*b^3*e^4*f*x*(b^2 - 4*a*c)^(1/2
) + 3*c^3*d^4*g*x*(b^2 - 4*a*c)^(1/2) + 16*a^2*c^2*d*e^3*f - a*b^3*d^2*e^2*h + 2*a^2*b^2*d*e^3*h + 2*b^2*c^2*d
^3*e*f - b^3*c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